package com.itjavas.cslp2.controller;

import com.itjavas.cslp2.mapper.NoticeMapper;
import com.itjavas.cslp2.pojo.entity.Notice;
import com.itjavas.cslp2.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/notice")
public class NoticeController {
    @Autowired
    NoticeService noticeService;
    //创建公告
    @RequestMapping("/createNotice")
    public ResponseEntity<Boolean> createNotice(@RequestBody Notice notice){
        return noticeService.createNotice(notice);
    }

    //编辑公告
    @RequestMapping("/editNotice")
    public ResponseEntity<Boolean> editNotice(@RequestBody Notice notice){
        return noticeService.editNotice(notice);
    }
}
